import 'package:xin_he/generated/json/base/json_field.dart';
import 'package:xin_he/generated/json/xin_he_new_order_detail_entity.g.dart';
import 'dart:convert';

@JsonSerializable()
class XinHeNewOrderDetailEntity {
	String? id;
	String? fUserId;
	String? code;
	dynamic payTime;
	double? orderFee;
	double? orderPayFee;
	String? status;
	String? distributionType;
	String? buyerRemark;
	String? createTime;
	int? orderAmount;
	dynamic fGoodsId;
	dynamic fGoodsPriceId;
	int? zoneType;
	List<XinHeNewOrderDetailOrderItems>? orderItems;
	String? orderAddress;

	XinHeNewOrderDetailEntity();

	factory XinHeNewOrderDetailEntity.fromJson(Map<String, dynamic> json) => $XinHeNewOrderDetailEntityFromJson(json);

	Map<String, dynamic> toJson() => $XinHeNewOrderDetailEntityToJson(this);

	XinHeNewOrderDetailEntity copyWith({String? id, String? fUserId, int? zoneType,String? code, dynamic payTime, double? orderFee, double? orderPayFee, String? status, String? distributionType, String? buyerRemark, String? createTime, int? orderAmount, dynamic fGoodsId, dynamic fGoodsPriceId, List<XinHeNewOrderDetailOrderItems>? orderItems, String? orderAddress}) {
		return XinHeNewOrderDetailEntity()
			..id= id ?? this.id
			..fUserId= fUserId ?? this.fUserId
			..code= code ?? this.code
			..payTime= payTime ?? this.payTime
			..orderFee= orderFee ?? this.orderFee
			..orderPayFee= orderPayFee ?? this.orderPayFee
			..status= status ?? this.status
			..distributionType= distributionType ?? this.distributionType
			..buyerRemark= buyerRemark ?? this.buyerRemark
			..createTime= createTime ?? this.createTime
			..orderAmount= orderAmount ?? this.orderAmount
			..fGoodsId= fGoodsId ?? this.fGoodsId
			..fGoodsPriceId= fGoodsPriceId ?? this.fGoodsPriceId
			..orderItems= orderItems ?? this.orderItems
			..orderAddress= orderAddress ?? this.orderAddress
		  ..zoneType = zoneType ?? this.zoneType;

	}

	@override
	String toString() {
		return jsonEncode(this);
	}
}

@JsonSerializable()
class XinHeNewOrderDetailOrderItems {
	String? goodsId;
	int? goodsPriceId;
	int? goodsAmount;
	double? itemPrice;
	String? goodsName;
	String? iconPath;

	XinHeNewOrderDetailOrderItems();

	factory XinHeNewOrderDetailOrderItems.fromJson(Map<String, dynamic> json) => $XinHeNewOrderDetailOrderItemsFromJson(json);

	Map<String, dynamic> toJson() => $XinHeNewOrderDetailOrderItemsToJson(this);

	XinHeNewOrderDetailOrderItems copyWith({String? goodsId, int? goodsPriceId, int? goodsAmount, double? itemPrice, String? goodsName, String? iconPath}) {
		return XinHeNewOrderDetailOrderItems()
			..goodsId= goodsId ?? this.goodsId
			..goodsPriceId= goodsPriceId ?? this.goodsPriceId
			..goodsAmount= goodsAmount ?? this.goodsAmount
			..itemPrice= itemPrice ?? this.itemPrice
			..goodsName= goodsName ?? this.goodsName
			..iconPath= iconPath ?? this.iconPath;
	}

	@override
	String toString() {
		return jsonEncode(this);
	}
}